/*  Copyright 2019 Jimmy Hogoboom
 *
 *  This file is part of crumb.
 *
 *  crumb is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  crumb is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with crumb.  If not, see <https://www.gnu.org/licenses/>.
 */

using System;
using System.Collections.Generic;
using crumb.Api.Core.Domain.Accounts;
using crumb.Api.Core.Domain.ValueObjects;
using NUnit.Framework;

namespace crumb.Api.Core.Domain.Accounts
{
    [TestFixture]
    public class AccountTests
    {
        private readonly Account _account;
        private readonly Guid Id = Guid.Parse("a8bc7a5a-9ebb-43ae-aafa-8af433b55135");
        private readonly Guid UserId = Guid.Parse("4648a1fb-0392-498f-982a-fbcf522f1e44");
        private const string Name = "Jimmy's Account";
        private const string NameChanged = "Foo's Account";
        private const string Title = "My Account";
        private const string TitleChanged = "Foo Account";
        private const string Description = "My description.";
        private readonly Image Avatar = new Image();
        private readonly Image Background = new Image();
        private const bool DoShowLikes = true;

        public AccountTests()
        {
            _account = new Account(UserId, Name, Title);
        }

        [Test]
        public void TestConstruction()
        {
            var account = new Account(UserId, Name, Title);

            Assert.That(account.UserId,
                Is.EqualTo(UserId));
            Assert.That(account.Name,
                Is.EqualTo(Name));
            Assert.That(account.Title,
                Is.EqualTo(Title));
        }

        [Test]
        public void TestGetAndSetId()
        {
            _account.Id = Id;

            Assert.That(_account.Id,
                Is.EqualTo(Id));
        }

        [Test]
        public void TestSetAndGetName()
        {
            _account.Name = NameChanged;

            Assert.That(_account.Name,
                Is.EqualTo(NameChanged));
        }

        [Test]
        public void TestSetAndGetTitle()
        {
            _account.Title = TitleChanged;

            Assert.That(_account.Title,
                Is.EqualTo(TitleChanged));
        }

        [Test]
        public void TestSetAndGetDescription()
        {
            _account.Description = Description;

            Assert.That(_account.Description,
                Is.EqualTo(Description));
        }

        [Test]
        public void TestSetAndGetAvatar()
        {
            _account.Avatar = Avatar;

            Assert.That(_account.Avatar,
                Is.EqualTo(Avatar));
        }

        [Test]
        public void TestSetAndGetBackground()
        {
            _account.Background = Background;

            Assert.That(_account.Background,
                Is.EqualTo(Background));
        }

        [Test]
        public void TestSetAndGetDoShowLikes()
        {
            _account.DoShowLikes = DoShowLikes;

            Assert.That(_account.DoShowLikes,
                Is.EqualTo(DoShowLikes));
        }
    }
}